<template>
  <div>
    <h1>json内容编辑</h1>
    <json-editor-vue
        class="editor"
        v-model="jsonData"
        :currentMode="currentMode"
        :modeList="modeList"/>
  </div>
</template>

<script lang="ts" setup>
import {ref} from "vue";

const modeList = ["tree", "code", "view"]
const currentMode = 'view'

const jsonData = ref<object>({
  dataContent: {
    "server": {
      "port": 2001
    },
    "spring": {
      "datasource": {
        "url": "jdbc:sqlite:file:./db/instance/simplify_work.sqlite"
      }
    },
    "logging": {
      "level": {
        "com.baomidou.mybatisplus": "debug",
        "com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBean": "debug"
      }
    },
    "mybatis-plus": {
      "configuration": {
        "log-impl": "org.apache.ibatis.logging.stdout.StdOutImpl",
        "auto-ddl": {
          "enabled": true,
          "executeDdl": true
        }
      }
    },
    "swagger": {
      "enabled": true,
      "title": "模板系统接口api",
      "description": "模板管理系统",
      "version": 1,
      "host": "localhost:${server.port}",
      "contact": {
        "name": "wanger",
        "email": "3245073527@qq.com"
      },
      "api-key": {
        "name": "token",
        "keyname": "token",
        "pass-as": "header"
      }
    }
  }
})
</script>
<style>
.editor {
  height: 70vh;
}
</style>